Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Using the Section Editor
Now you’re ready to look at some of the code the AppBuilder has generated for you.
![]()
To view the code the AppBuilder created:
- Stop your window, and then click the Edit Code icon in the main window:
![]()
The Section Editor appears. This is where you examine and write all your 4GL code when you’re using the AppBuilder. If you drop down the Section list, you see that there are five types of sections the Section Editor maintains for you:
- Definitions — A section at the top of your procedure where you can write variable definitions and other statements that are needed by the whole procedure.
- Triggers — Blocks of code that execute when an event occurs (for example, when a user clicks a button). You’ll write some triggers of your own just ahead.
- Main Block — The part of the 4GL code that is executed as soon as the procedure starts up. You’ll look at the main block of this sample procedure below and see what it does for you.
- Procedures — Internal procedures, exactly like the one you wrote in Chapter 3, " Running Progress 4GL Procedures."
- Functions — User-defined functions are like internal procedures, but they return a value to the statement that uses them, just as the built-in 4GL functions you used in Chapter 2 "Using Basic 4GL Constructs" do.
- Select Procedures from the list of section types:
![]()
- From the list of internal procedures (the Name drop-down list), select enable_UI:
![]()
The AppBuilder generates this code to get your window started. This code does all the things that make the window, and then the data, appear.
Note that the AppBuilder has generated the header statement
PROCEDURE enable_UIfor you, but doesn’t show it except to show the procedure name. Also note that the procedure is marked Read-Only. That’s because the AppBuilder created it and doesn’t want you to make any changes to it directly. If you change any objects in the design window, it changes the code for you.When you create new procedures of your own, you can edit them in the Section Editor just as you did in the Procedure Editor.
Next you take a look at this code to see what it’s doing for you. A word of warning before you start: Because this is AppBuilder-generated code, some of it isn’t as readable as it might be if you wrote it by hand. The whole idea is that you almost never need to look at this code. But you’re going to do that here so that you understand what’s going on behind the scenes.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |